﻿<?php
if (!defined('INDEX')) {
    exit ('Access Denied');
}
include(TPLPATH . '/admin_set/miaozhe.php');
$parameter = act_wap_miaozhe();
$parameter['webtitle'] = $dd_tpl_data['title'] . '触屏版';
extract($parameter);
include(TPLPATH . '/inc/header.tpl.php'); ?>
    <script>
        var floorStep = 2;
        var ajaxTag = 0;
        $(function () {
            $(window).bind('scroll', function () {
                if ($(window).scrollTop() + $(window).height() >= $(document).height() - 800) {
                    if (ajaxTag == 0) {
                        ajaxTag = 1;
                        jiazai(floorStep);
                        floorStep++;
                    }
                }
            });
            $('.shuju_load img.lazy').lazyload({
                threshold: 20,
                failure_limit: 50
            });
        });
	//这里的格式不能动！
        function index_tpl() {/*<li class="claer">   <a href="{$url}">
		            <span class="tupian"> <img data-original="{$img}" title="{$title}" class="lazy" src="<?=$dd_tpl_data['loading_img']?>" alt="{$title}" border="0"/> </span>   <?php if($row['is_new']){?><span class="xinpin"></span>  <?php }?>  </a>
					
<div class="lingquan"><a href="{$lq_url}" target="_blank" rel="nofollow"><span>领券省<em>{$price_jian}元</em></span><b></b></a></div>

              <a href="{$url}"><span class="biaoti">{$title}</span></a>
                         <span class="jiage">
		                   <span class="title-tips01">券后</span>  <span>￥</span>{$youhuiquan}
		                    <del>{$price}</del>
		                <span class="baoyou">{$laiyuan}</span> </span>
		                <div class="inblock guan" style="position:absolute;top:0;left:0;">
							<div class="jy_w_buy">
								<div title="{$laiyuan_text}" class="{$laiyuan_class}"><i></i></div>
							</div>
						</div>
                    </li>*/}

        function jiazai(floorStep) {
            $('.chakan_more').text('数据获取中……');
            var url = '<?=wap_l(MOD, ACT)?>&code=' + '<?=$code?>' + '&q=' + '<?=$_GET['q']?>' + '&cid=' + '<?=$_GET['cid']?>' + '&page=' + floorStep;
            var url2 = '<?=wap_l("goods", "index")?>&code=' + '<?=$code?>' + '&q=' + '<?=$_GET['q']?>' + '&cid=' + '<?=$_GET['cid']?>' + '&page=' + floorStep;


            $.getJSON(url2, function (data) {
                ajaxTag = 0;
                if (data.s == '1') {
                    if (data.r == '' || data.r == 'null' || data.r == null) {

                        ajaxTag = 1;
                        $('.chakan_more').hidden();
                    }
                    else {
                        for (i in data.r) {
                            row = data.r[i];
                            var html = getTplObj(index_tpl, row);
                            $('.shuju_load').append(html);
                        }
                        $('.chakan_more').text('点击更多');
                        $('.shuju_load img.lazy').lazyload({
                            threshold: 20,
                            failure_limit: 50
                        });
                    }
                }
            });
        }
    </script>
    <!--幻灯片开始-->
    <style type="text/css">
        .indexdl {
            background: #FFFFFF;
            width: 100%;
            height: 0px;
            padding: 15px 0 25px 0;
        }

        .tuichu {
            background: <?=$dd_tpl_data['color']?>;
            width: 96%;
            float: left;
            padding: 15px 0;
            margin-left: 5px;
            margin-top: 5px;
            font-size: 16px;
            text-align: center;
            color: #fff;
            border-radius: 4px;
        }

        .tuichu a {
            text-align: center;
            color: #fff;
            font-weight: 600
        }
        .jy_w_buy
        {
            float:right; overflow:hidden; text-align:right
        }
        .jy_w_buy .tb
        {
            width:20px; margin-left:15px;
            height:20px;
            float:right;
            color:#CE0000;
            font-size:14px;
            line-height:20px;
            margin-top:5px;
            *margin-top:2px;
        }
        .jy_w_buy .tmall
        {
            width:20px;margin-left:15px;
            height:20px;
            float:right;
            color:#CE0000;
            font-size:15px;
            line-height:20px;
            margin-top:5px;
            *margin-top:2px;
        }
        .jy_w_buy .jd
        {
            min-width:20px;
            height:20px;
            float:right;
            color:#CE0000;
            font-size:15px;
            line-height:20px;
            margin-top:5px;
            *margin-top:2px;
        }
        .jy_w_buy .paipai
        {
            min-width:50px;
            height:20px;
            float:right;
            color:#CE0000;
            font-size:15px;
            line-height:20px;
            margin-top:5px;
            *margin-top:2px;
        }
        .jy_w_buy .tb i
        {
            width:20px;
            height:20px; vertical-align:bottom; margin-bottom:3px;
            display:inline-block;
            background:url(m/template/miaozhewap/inc/images/tb.png) no-repeat;
            margin-right:5px;
        }
        .jy_w_buy .tmall i
        {
            width:20px;
            height:20px;vertical-align:bottom; margin-bottom:3px;
            display:inline-block;
            background:url(m/template/miaozhewap/inc/images/tmall_ico.png) no-repeat;
            margin-right:5px;
        }
        .jy_w_buy .jd i
        {
            width:20px;
            height:20px;vertical-align:bottom; margin-bottom:3px;
            display:inline-block;
            background:url(m/template/miaozhewap/inc/images/jd_ico.png) no-repeat;
            margin-right:5px;
        }

        .jy_w_buy .paipai i
        {
            width:15px;
            height:15px;vertical-align:bottom; margin-bottom:3px;
            display:inline-block;
            background:url(m/template/miaozhewap/inc/images/pai_ico.png) no-repeat;
            margin-right:5px;
        }
		.ad-title {
			font-size:18px;
			color:orange;
			text-align:center;
			padding:5px 10px;
			font-weight:bold;
			margin-top:15px;
		}
    </style>
    <div style="margin-top:44px"></div>
<?php if ($dd_tpl_data['dl-kg']['open'] == 0) { ?>
    <?php if ($dduser['id'] > 0) { ?>
        <div class="indexdl"><span style="float:left; margin-left:10px; font-size:14px; color:#888"> <a
                        href="<?= wap_l('user', 'tixian', array('type' => 2)) ?>"><div class="yue"></div>我的余额：<font
                            color="#FF0000"><?= $dduser['money'] ?></font> 元</a></span>
            <span style="float:right; margin-right:10px; font-size:14px;color:#888"><a
                        href="<?= wap_l('user', 'tixian', array('type' => 1)) ?>"><div
                            class="jifenbao"></div>我的集分宝：<font
                            color="#FF0000"><?= $dduser['jifenbao'] ?></font> <?= TBMONEYUNIT ?></a></span></div>
    <?php } else { ?>
        <!-- <div class="indexdl"><span style="float:left; margin-left:10px; font-size:14px; color:#888"> <a
                        href="<?= wap_l('user', 'register') ?>" style="display: none;"><div class="zhuce"></div>10秒免费注册</a></span>
            <span style="float:right; margin-right:10px; font-size:14px;color:#888"><a
                        href="<?= wap_l('user', 'login') ?>" style="display: none;"><div class="denglu"></div>会员登录</a></span></div> -->
    <?php } ?>
<?php } ?>
<?php if (!empty($slides)) { ?>
    <div class="scroll">
        <div class="slide_01" id="slide_01">
            <?php foreach ($slides as $row) { ?>
                <div class="mod_01"><a href="<?= $row['url'] ?>"><img src="<?= $row['img'] ?>"
                                                                      alt="<?= $row['title'] ?>"/></a></div>  <?php } ?>
        </div>
        <div class="dotModule_new">
            <div id="slide_01_dot"></div>
        </div>
    </div>
<?php } ?>
    <!--幻灯片结束-->

    <!--首页导航图标开始-->
    <div class="vipduo_list clear">
        <div class="vipduo_tu">
            <ul id="thelist">
                <?php foreach ($bankuai_wap as $row) { ?>
                    <a href="<?= $row['url'] ?>"><span
                                style="background:url(<?= $row['img'] ?>) 0px 0px; background-size:60px 60px; width:60px !important;height:60px !important;"
                                class="span1"></span><span class="span2"><?= $row['title'] ?></span></a>
                <?php } ?>
            </ul>
            <?php /*?><?php if($dd_tpl_data['fllm-kg']['open']==1){?>
<?php foreach($bankuai_wap as $row){?>
<a href="<?=$row['url']?>"><img src="<?=$row['img']?>"><span><?=$row['title']?></span></a>
   <?php }?> <?php }?>
<?php if($dd_tpl_data['fllm-kg']['open']==0){?> <a href="<?=wap_l('goods','index',array('code'=>chaofan))?>"><img src="<?=TPLURL?>/inc/images/daohang/chao.png" width="100%"><span>超高返</span></a>
<a href="<?=wap_l('goods','index',array('code'=>'quan'))?>"><img src="<?=TPLURL?>/inc/images/daohang/quan.png" width="100%"><span>优惠券</span></a>
 <a href="<?=wap_l('goods','index',array('code'=>jiu))?>"><img src="<?=TPLURL?>/inc/images/daohang/9.png" width="100%"><span>9块9包邮</span></a>
 <a href="<?=wap_l('goods','index',array('code'=>shijiu))?>"><img src="<?=TPLURL?>/inc/images/daohang/dd.png" width="100%"><span>20元封顶</span></a>
<a href="<?=wap_l('goods','index',array('code'=>jd))?>"><img src="<?=TPLURL?>/inc/images/daohang/hui.png" width="100%"><span>京东超返</span></a> <?php }?>
 <a href="<?=wap_l('huan','index')?>"><img src="<?=TPLURL?>/inc/images/daohang/huan.png" width="100%"><span>礼品兑换</span></a>
<a href="<?=wap_l('user','invite')?>&rec=<?=$dduser['id']?>"><img src="<?=TPLURL?>/inc/images/daohang/jl.png" width="100%"><span>邀请赚钱</span></a>
 <a href="<?=wap_l('tao','index')?>"><img src="<?=TPLURL?>/inc/images/daohang/tb.png" width="100%"><span>淘宝返利</span></a>
 <a href="<?=wap_l('mall','index')?>"><img src="<?=TPLURL?>/inc/images/daohang/sc.png" width="100%"><span>商城返利</span></a>
 <a href="http://wpa.qq.com/msgrd?v=3&amp;uin=<?=$dd_tpl_data['qq']?>&amp;site=qq&amp;menu=yes"><img src="<?=TPLURL?>/inc/images/user/qq.png" width="100%"><span>联系客服</span></a><?php */ ?>
        </div>
    </div>
	  <div class="clear"></div>
	<div style="border-bottom: 1px solid #e9e9e9;background: #fff;overflow: hidden;">
	<p class="ad-title">——————每日优选——————</p>
	<?=AD(1039)?>
	</div>
	    <div class="clear"></div>
	<?=AD(1040)?>
	<!--
	<?php 
		$i = 115;
		$ad_info = $duoduo->select('ad', '*', 'id=1000');
		if ($ad_info['is_show'] == '1') {
	?>
    <div style="border-bottom: 1px solid #e9e9e9;background: #fff;overflow: hidden;">
		<p class="ad-title">——————<?= $ad_info['text'] ?>——————</p>
        <ul>
            <li style="float:left;width:50% !important; overflow:hidden;"><?= AD(109) ?></li>
            <li style="float:left;width:50% !important; overflow:hidden;"><?= AD(110) ?></li>
            <li style="float:left;width:50% !important; overflow:hidden;"><?= AD(111) ?></li>
            <li style="float:left;width:50% !important; overflow:hidden;"><?= AD(112) ?></li>
            <li style="float:left;width:50% !important; overflow:hidden;"><?= AD(113) ?></li>
            <li style="float:left;width:50% !important; overflow:hidden;"><?= AD(114) ?></li>
			<?php
				while($i < 200) {
			?>
				<li style="float:left;width:50% !important; overflow:hidden;"><?= AD($i) ?></li>
			<?php $i+=1;} ?>
			<li style="float:left;width:100% !important; overflow:hidden;"><?= AD(9999) ?></li>
            <div style="clear:both;"></div>
        </ul>
    </div>
		<?php } ?>
		---!>
		
		
		

<?php /*?><div style="border-bottom:1px solid #e9e9e9; background:#fff; overflow:hidden">
    <a style="width:43%; float:left; border-right:1px solid #e9e9e9;" href="<?=wap_l('goods','index',array('code'=>'jd'))?>"><img src="<?=TPLURL?>/inc/images/jd_lm_cf.png" width="100%" /></a>
	<a style="width:56.5%; float:left; border-bottom:1px solid #e9e9e9;" href="<?=wap_l('goods','index',array('code'=>'jiu'))?>"><img src="<?=TPLURL?>/inc/images/99.png" width="100%" /></a>
	<a style="width:56.5%; float:left;"  href="<?=wap_l('goods','index',array('code'=>'shijiu'))?>"><img src="<?=TPLURL?>/inc/images/20fd.png" width="100%" /></a>
    <div style="clear:both"></div>
    <a style="width:43%; float:left; border-right:1px solid #e9e9e9;border-top:1px solid #e9e9e9;" href="<?=wap_l('mall','index')?>"><img src="<?=TPLURL?>/inc/images/mall.png" width="100%" /></a>
	<a style="width:56.5%; float:left;border-top:1px solid #e9e9e9;" href="<?=wap_l('goods','index',array('code'=>'chaofan'))?>"><img src="<?=TPLURL?>/inc/images/30fl.png" width="100%" /></a>
 <div style="clear:both;"></div>
</div><?php */ ?>
	<?php 
		$ad_info = $duoduo->select('ad', '*', 'id=1001');
		$j = 500;
		if ($ad_info['is_show'] == '1') {
	?>
		<div style="border-bottom: 1px solid #e9e9e9;background: #fff;overflow: hidden;">
		<p class="ad-title" style="color:black;">———&nbsp;&nbsp;<?= $ad_info['text'] ?>&nbsp;&nbsp;———</p>
        <ul>
			<?php
				while($j < 600) {
			?>
				<li style="float:left;width:50% !important; overflow:hidden;"><?= AD($j) ?></li>
			<?php $j+=1;} ?>
            <div style="clear:both;"></div>
        </ul>
    </div>	
	<?php } ?>
	<?php 
		$ad_id = 2000;
		$aid = 3000;
		while($ad_id < 2020) {
			$max_aid = $aid + 10;
			$ad_info = $duoduo->select('ad', '*', "tag='$ad_id'");
			if ($ad_info['is_show'] == '1') {
		?>
				<div style="border-bottom: 1px solid #e9e9e9;background: #fff;overflow: hidden;">
				<p class="ad-title" style="color:black;">———&nbsp;&nbsp;<?= $ad_info['text'] ?>&nbsp;&nbsp;———</p>
				<ul>
					<?php
						while($aid < $max_aid) {
					?>
						<li style="float:left;width:50% !important; overflow:hidden;"><?= AD($aid) ?></li>
					<?php $aid+=1;} ?>
					<div style="clear:both;"></div>
				</ul>
				</div>	
			<?php } ?>
	<?php $ad_id+=1;} ?>
    <ul class="remai2 shuju_load">
        <?php foreach ($shuju_data as $k => $row) { ?>
            <li class="claer"><a href="<?= $row['url'] ?>">
                    <span class="tupian"> <img data-original="<?= tb_img($row['img'], 800) ?>"
                                               title="<?= $row['title'] ?>" class="lazy"
                                               src="<?= $dd_tpl_data['loading_img'] ?>" alt="<?= $row['title'] ?>"
                                               border="0"/> </span> <?php if ($row['is_new']) { ?><span
                            class="xinpin"></span>  <?php } ?>  </a>
                <?php if ($row['price_man'] > 0) { ?>
                    <a href="<?= $row['lq_url'] ? $row['lq_url'] : 'javascript:void(0)' ?>">
                        <div class="quan_img"><span class="num_money left"><?= $row['price_jian'] ?></span></div>
                    </a>  <?php } ?>
                <a href="<?= $row['url'] ?>"><span class="biaoti"><?= $row['title'] ?></span></a>
                <span class="jiage">
		                  <?php if ($row['price_man'] > 0) { ?> <span class="title-tips01">券后</span><?php } ?>
                    <span>￥</span><?= $row['quanhoujia'] ?>
                    <?php if ($code == 'zhidemai') { ?><?php } else { ?>
                        <del><?= $row['price'] ?></del> <?php } ?>
                    <span class="baoyou"><?= $row['laiyuan'] ?></span> </span>
                <span class="fan">
                <div class="inblock guan" style="position:absolute;top:0;left:0;">
                    <div class="jy_w_buy">
                        <?php if ($row['laiyuan_type'] == 1) { ?>
                            <div title="淘宝" class="tb"><i></i></div><?php } ?>

                        <?php if ($row['laiyuan_type'] == 2) { ?>
                            <div title="天猫" class="tmall"><i></i></div><?php } ?>
                        <?php if ($row['laiyuan_type'] == 3) { ?>
                            <div title="京东商城" class="jd"><i></i></div><?php } ?>
                        <?php if ($row['laiyuan_type'] == 4) { ?>
                            <div title="拍拍" class="paipai"><i></i></div><?php } ?>
                    </div>
                </div>
				<span class="xiaoliang" style="float:left;color:#808080;display:block;margin-left:5px;">月销&nbsp;<?= $row['xiaoliang'] ?></span>
				<span class="pingfen" style="float:right;color:#808080;display:block;margin-right:13px;">评分&nbsp;<?= $row['pingfen'] ?></span>
            </li>
        <?php } ?>
    </ul>
    <div class="clear"></div>
    <div style="height:10px;line-height:10px; clear:both"></div>


<?php /*?><div class="tuichu"><a  href="<?=wap_l('goods','index',array('code'=>''.$dd_tpl_data['bsm'].''))?>">查看更多</a></div><?php */ ?>

    </div>
    <div class="clear"></div>
    <div style="height:18px;line-height:18px; clear:both"></div>
    <a href="javascript:scroll(0,0)" hidefocus="true" title="回到顶部" id="scrollTop"></a>
    <script type="text/javascript" src="<?= TPLURL ?>/inc/js/scroll.js"></script>
    <script type="text/javascript">
        if (document.getElementById("slide_01")) {
            var slide_01 = new ScrollPic();
            slide_01.scrollContId = "slide_01"; //内容容器ID
            slide_01.dotListId = "slide_01_dot";//点列表ID
            slide_01.dotOnClassName = "selected";
            slide_01.arrLeftId = "sl_left"; //左箭头ID
            slide_01.arrRightId = "sl_right";//右箭头ID
            slide_01.frameWidth = 360;
            slide_01.pageWidth = 360;
            slide_01.upright = false;
            slide_01.speed = 10;
            slide_01.space = 30;
            slide_01.initialize(); //初始化
        }
    </script>
<?php include(TPLPATH . '/inc/footer.tpl.php'); ?>